package com.sh.list;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

/**
 * @Auther: sh
 * @Version 1.0
 * @Description:
 */
public class Test1 {
    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
        list. add("x");
        Collection<String> clist = Collections. unmodifiableCollection(list);
        clist. add("y"); // 运行时此行报错
        System. out. println(list. size());

        List<String> synchronizedList = Collections.synchronizedList(list);

    }
}

